home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEM / D-H / Effects Specialist.sea / EffectsSpecialistDemo™.rsrc / FYps_1001_MyTools < prev    next >
Text File  |  1991-06-19  |  6KB  |  105 lines

  1. /CMYKwhite { 0 0 0 1 } def
  2. /CMYKblack { 0 0 0 0 } def
  3. /setcmykcolor where
  4.   { pop } %% if known, no ok
  5.   { /setcmykcolor { /G1k exch 1 exch sub def
  6.       3 copy add add 0 eq
  7.         { pop pop pop G1k setgray }
  8.           { 3 { G1k exch sub dup 0 lt {pop 0} if 3 1 roll } repeat setrgbcolor }
  9.         ifelse } def
  10.     /currentcmykcolor { currentrgbcolor
  11.       3 { 1 exch sub 3 1 roll } repeat
  12.       0 } def
  13.     } ifelse
  14. /SMG { %% c b y k SMG
  15.   /G2k exch def /G2y exch def /G2m exch def /G2c exch def
  16.   G2c G2m G2y add add 0 eq
  17.       { 0 0 0  1 G2k sub  setcmykcolor }
  18.       { G2c G2k sub  G2m G2k sub  G2y G2k sub  0  setcmykcolor } ifelse
  19.   G2k 1.05 ne } def
  20. /WGV { %% 1stRBG 2ndRGB steps index -WGV- ScaledRGB
  21.   /Wix exch def /Wst exch def
  22.   /W2v exch def /W2b exch def /W2g exch def /W2r exch def
  23.   /W1v exch def /W1b exch def /W1g exch def /W1r exch def
  24.   W2r W1r sub Wst div Wix mul W1r add    W2g W1g sub Wst div Wix mul W1g add
  25.   W2b W1b sub Wst div Wix mul W1b add    W2v W1v sub Wst div Wix mul W1v add } def
  26. /MyF { SMG {TheFill} if } def
  27. /MyC { clip } def
  28. /MyS { SMG {stroke} if } def
  29. /Pi 3.1415923 def
  30. /tan { dup sin exch cos dup 0 eq { pop pop 9999999999 } { div } ifelse } def %% degrees tan num
  31. /myatn { 2 copy 0 eq exch 0 eq and {1} {atan} ifelse } def %% num den myatn num
  32. /RANDY { rand 2147483647 div mul } def %% num RANDY #(0..num)
  33. /ZeroShow { newpath 0 0 moveto show } def %% (text) ZeroShow
  34. /TCP { newpath 0 0 moveto true charpath } def %% (text) TCP
  35. /FCP { newpath 0 0 moveto false charpath } def %% (text) FCP
  36. /ClipTo { true charpath flattenpath MyC } def %% (text) ClipTo
  37.  
  38. /BOGS { /first exch def /tt exch def /bMt exch def /bMr exch def /bMb exch def /bMl exch def
  39.   tt true charpath flattenpath pathbbox /bBt exch def /bBr exch def /bBb exch def /bBl exch def 
  40.    first { /bMl bBl def   /bMb bBb def /bMr bBr def   /bMt bBt def }
  41.      { bBl bMl lt { /bMl bBl def } if   bBb bMb lt { /bMb bBb def } if
  42.        bBr bMr gt { /bMr bBr def } if   bBt bMt gt { /bMt bBt def } if } ifelse
  43.   bMl bMb bMr bMt } def
  44. /BOGG { /tt exch def  /ff true def
  45.   gsave [1 0 0 1 0 0] setmatrix   
  46.   newpath 0 0 moveto  kR 0 0 0 0 
  47.   tt { FXChar exch 0 exch put  FXChar ff BOGS
  48.        currentpoint newpath moveto  /ff false def } forall
  49.   kR } def 
  50. /BBproc { %% /t /r /b /l (text) BBproc
  51.   /tt exch def  tt BOGG
  52.   /bBt exch def /bBr exch def /bBb exch def /bBl exch def grestore
  53.   gsave newpath 0 0 moveto 0 0 /bCy exch def /bCx exch def
  54.     tt stringwidth /bWy exch def /bWx exch def grestore
  55.   /bSr /bSl  bCx bWx lt { bCx def bWx def } { bWx def bCx def } ifelse
  56.   /bSt /bSb  bCy bWy lt { bCy def bWy def } { bWy def bCy def } ifelse
  57.   bSl bBl lt {bSl}{bBl} ifelse def   bSb bBb lt {bSb}{bBb} ifelse def
  58.   bSr bBr gt {bSr}{bBr} ifelse def   bSt bBt gt {bSt}{bBt} ifelse def } def
  59. /BB+proc { %% /t # /r # /b # /l # (text) BB+proc  {#=value added}
  60.   /tt exch def  tt BOGG
  61.   /bBt exch def /bBr exch def /bBb exch def /bBl exch def grestore
  62.   gsave newpath 0 0 moveto 0 0 /bCy exch def /bCx exch def 
  63.     tt stringwidth /bWy exch def /bWx exch def grestore
  64.   /bSr /bSl  bCx bWx lt { bCx def bWx def } { bWx def bCx def } ifelse
  65.   /bSt /bSb  bCy bWy lt { bCy def bWy def } { bWy def bCy def } ifelse
  66.   bSl bBl lt {bSl}{bBl} ifelse add def   bSb bBb lt {bSb}{bBb} ifelse add def
  67.   bSr bBr gt {bSr}{bBr} ifelse add def   bSt bBt gt {bSt}{bBt} ifelse add def } def
  68.  
  69. /Box { /bxl exch def /bxb exch def /bxr exch def /bxt exch def %% t r b l Box
  70.   bxl bxb moveto bxl bxt lineto bxr bxt lineto bxr bxb lineto closepath } def
  71. /rBox { /bxh exch def /bxw exch def %% wid hei rBox at currentpoint
  72.   bxw 0 rlineto 0 bxh rlineto bxw neg 0 rlineto closepath } def
  73. /kP { /FXChar ( ) def /totKern 0 def /KernNet 0 KernArray { add } forall def } def
  74. /kR { /FXChar ( ) def /totKern 0 def /kerncount 0 def } def
  75. /NEXTkern { /totKern totKern KernArray kerncount get add FXChar stringwidth pop add def
  76.   KernArray kerncount get 0 translate /kerncount kerncount 1 add def } def
  77. /NEXT { /totKern totKern KernArray kerncount get add FXChar stringwidth pop add def
  78.   KernArray kerncount get 0 translate FXChar stringwidth translate /kerncount kerncount 1 add def } def
  79. /fillEffect { FXChar exch 0 exch put FXChar TCP InsideShade MyF NEXT } def
  80. /strokeEffect { FXChar exch 0 exch put FXChar TCP OutlineShade MyS NEXT } def
  81. /showEffect { FXChar exch 0 exch put FXChar ZeroShow NEXT } def
  82. /fsEffect { FXChar exch 0 exch put FXChar TCP gsave InsideShade MyF grestore OutlineShade MyS NEXT } def
  83. /kF { gsave  kR FXText { fillEffect } forall  grestore } def
  84. /kS { gsave OutlineSize setlinewidth  kR FXText { strokeEffect } forall  grestore } def
  85. /kH { gsave translate SMG { kR FXText { showEffect } forall  } if grestore } def %% gray tx ty kH
  86. /kFS { gsave OutlineSize setlinewidth  kR FXText { fsEffect } forall  grestore } def
  87. /s8 8 string def
  88. /pat { %% RGBColour FillNum FillPat pat
  89.   s8 copy pop 9.375 0 { 1 add 4 mul cvi s8 exch get exch 1 add 4 mul cvi
  90.   7 sub bitshift 1 and } setscreen 64 div SMG pop } def
  91. /numeric { /Tt7 exch def /ok7 true def %% (string) numeric bool
  92.   Tt7 { dup 48 lt exch 57 gt or { /ok7 false def } if } forall ok7 } def
  93. /WipeR2L {/Bb exch def /Bg exch def /Br exch def gsave r? 0 translate 1 setlinewidth
  94.   r? -1 l? { /ix exch def newpath Br Bg Bb ix r? l? sub div SMG pop
  95.     -1 0 translate 0 b? moveto 0 t? lineto stroke } for grestore } def
  96. /WipeT2B {/Bb exch def /Bg exch def /Br exch def gsave 0 t? b? sub translate 1 setlinewidth
  97.   t? -1 b? { /ix exch def newpath Br Bg Bb ix t? b? sub div SMG pop
  98.     0 -1 translate l? b? moveto r? l? sub 0 rlineto stroke } for grestore } def
  99. /WipeL2R {/Bb exch def /Bg exch def /Br exch def gsave l? 0 translate 1 setlinewidth
  100.   r? -1 l? {/ix exch def newpath Br Bg Bb ix r? l? sub div SMG pop
  101.     1 0 translate 0 b? moveto 0 t? lineto stroke} for grestore } def
  102. /WipeB2T {/Bb exch def /Bg exch def /Br exch def gsave 0 0 translate 1 setlinewidth
  103.   t? -1 b? { /ix exch def newpath Br Bg Bb ix t? b? sub div SMG pop
  104.     0 1 translate l? b? moveto r? l? sub 0 rlineto stroke } for grestore } def
  105.